<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="jian">-</button>
        <span>{{number}}</span>
        <button @click="jia">+</button>
    </div>
    <script src="../Dev-tools/vue.js"></script>
    <script>
        new Vue({
            el:"#app",
            data:{
                number:0
            },
            methods:{
                jia(){
                    this.number++
                },
                jian(){
                    if(this.number>0){
                       this.number--
                    }
                }
            }
        })
    </script>
</body>
</html>